package com.lvchenglong.controller;

import com.lvchenglong.dto.UserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("/v1/users")
public class UserController {

    @Autowired
    UserDTO userDTO;

    @GetMapping("/{userId}")
    public UserDTO getUser(@PathVariable(value = "userId") Long userId) {
        return  userDTO;
    }

    @RequestMapping(value = "/login", method = {RequestMethod.POST})
    // @CrossOrigin
    public String login() {
        return "login susccessfully";
    }
}
